package org.ljy.rabbitmqspringboot.listener;

import org.ljy.rabbitmqspringboot.contant.Constants;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import org.yaml.snakeyaml.scanner.Constant;

@Component
public class FanoutListener {

    @RabbitListener(queues = Constants.FANOUT_QUEUE1)
    public void fanoutQueue1(String message) {
        System.out.println("fanout:队列["+Constants.FANOUT_QUEUE1+"] 接收到消息:" +message);
    }

    @RabbitListener(queues = Constants.FANOUT_QUEUE2)
    public void fanoutQueue2(String message) {
        System.out.println("fanout:队列["+Constants.FANOUT_QUEUE2+"] 接收到消息:" +message);
    }
}
